package com.egg.ylt.Utils;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

/**
 * Created By Dlx
 * on 2018/11/30 0030
 */
public abstract class SocketCallBack<Z> {
    public abstract void onConnected();

    public abstract void onDisconnected();

    public abstract void onReconnected();

    public abstract void onSend();

    public abstract void onReceived(Z msg);

    public abstract void onError(String msg);


    protected Type type;

    public SocketCallBack()
    {
        Type superClass = getClass().getGenericSuperclass();
        type = ((ParameterizedType)superClass).getActualTypeArguments()[0];
    }
}
